/**
 * Copyright 2010 Pavel Daniel Alexandru PFA
 * 
 * Licensed under the terms of the GNU Lesser General Public License version 3 
 * as published by the Free Software Foundation. You may obtain a copy of the
 * License at: http://www.gnu.org/copyleft/lesser.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations 
 * under the License. 
 */
package com.kobol.webclient.client.signin.view;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.ViewWithUiHandlers;
import com.kobol.webclient.client.signin.presenter.ErrorPagePresenter;

/**
 * @author Pavel Alexandru
 * 
 */
public class ErrorPageView extends ViewWithUiHandlers<ErrorPageUIHandlers> implements ErrorPagePresenter.MyView {

    private static String html = "<div>\n" + "<table align=\"center\">\n" + "  <tr>\n" + "<td>&nbsp;</td>\n"
	    + "</tr>\n" + "  <tr>\n" + "<td>&nbsp;</td>\n" + "</tr>\n" + "  <tr>\n" + "<td>&nbsp;</td>\n" + "</tr>\n"
	    + "  <tr>\n" + "    <td style=\"font-weight:bold;\">An error has occurred.</td>\n" + "  </tr>\n"
	    + "  <tr>\n" + "<td>&nbsp;</td>\n" + "</tr>\n" + "  <tr>\n"
	    + "<td>Try this action again. If the problem continues,</td>\n" + "</tr>\n" + "  <tr>\n"
	    + "<td>check the Kobol Webclient forums for a solution or</td>\n" + "</tr>\n" + "  <tr>\n"
	    + "<td>contact your Kobol Webclient administrator.</td>\n" + "</tr>\n" + "  <tr>\n" + "<td>&nbsp;</td>\n"
	    + "</tr>\n" + "  <tr>\n" + "    <td id=\"okButtonContainer\"></td>\n" + "  </tr>\n" + "</table>\n"
	    + "</div>\n";

    HTMLPanel panel = new HTMLPanel(html);

    private final Button okButton;

    @Inject
    public ErrorPageView() {
	okButton = new Button("OK");

	panel.add(okButton, "okButtonContainer");
    }

    @Override
    public Widget asWidget() {
	return panel;
    }

    @Override
    public Button getOkButton() {
	return okButton;
    }
}